-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: export recipe in the ConanFileInterface #18995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
memsharded
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution @araffin
I am afraid that it is not very clear what problem is being solved. It would be better to file an issue first to discuss the need of exposing certain things over the ConanFileInterface, as commented below, some of those things might even be an anti-pattern
conan/internal/model/dependencies.py
Outdated
| data = OrderedDict((k, v) for k, v in data.items() | ||
| # TODO: Make "recipe" part of ConanFileInterface model | ||
| if v._conanfile._conan_node.recipe != RECIPE_PLATFORM) | ||
| data = OrderedDict((k, v) for k, v in data.items() if not v.is_platform) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was done this way because we didn't want to expose this as part of the interface to consumers.
The idea that it is a platform thing should be transparent to consumers, if consumers need to check this, it is probably an anti-pattern
|
@memsharded I'm preparing a PR for the docs, updating https://github.com/conan-io/docs/blob/develop2/reference/conanfile/methods/generate.rst#selfdependencies
|
|
Merged, this will be in next Conan 2.22. Thanks for your contribution! :) |
Changelog: Feature: Expose
recipein theConanFileInterfacefor information purpose only.Docs: conan-io/docs#4264
closes #18996
explicit exports using the__all__variableSome additional context: currently there is no easy way for a generator to know if a dependency is editable, platform, ...
This PR exposes the recipe via the
ConanFileInterfaceso users don't have to use private method to have the info.For the__all__keywords, this makes it explicit what Conan exports and avoid "unused import" warnings with linters.developbranch, documenting this one.